class User extends CI_Model {

    function __construct()
    {
        parent::__construct();
    }
    
    function get_last_ten_entries()
    {
        $query = $this->db->get('user', 10);
        return $query->result();
    }

    function insert_entry()
    {
        $this->title   = $this->input->post('title'); // 请阅读下方的备注
        $this->content = $this->input->post('content');//$_POST['content'];
        $this->date    = time();

        $this->db->insert('user', $this);
    }
}
